package com.hkbigdata.sybx.service.ipml;


import com.hkbigdata.sybx.bean.UserFeedback;
import com.hkbigdata.sybx.mapper.UserFeedbackMapper;
import com.hkbigdata.sybx.service.UserFeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author liuanbo
 * @creat 2025-05-29-18:25
 * @see 2194550857@qq.com
 */
@Service
public class UserFeedbackImpl implements UserFeedbackService {
    @Autowired
    private UserFeedbackMapper userFeedbackMapper;
    @Override
    public boolean FeedbackInsert(UserFeedback userFeedback) {
        int i = userFeedbackMapper.insertUserFeedback(userFeedback);
        if (i > 0) {
            return true;
        }
        return false;
    }
    @Override
    public boolean deleteFeedbackByUserId(String userId) {
        int result = userFeedbackMapper.deleteUserFeedbackByUserId(userId);
        return result > 0;
    }

    @Override
    public boolean updateFeedback(UserFeedback userFeedback) {
        int result = userFeedbackMapper.updateUserFeedback(userFeedback);
        return result > 0;
    }

    @Override
    public List<UserFeedback> getFeedbackByUserId(String userId) {
        return (List<UserFeedback>) userFeedbackMapper.selectUserFeedbackByUserId(userId);
    }

    @Override
    public List<UserFeedback> getAllFeedback() {
        return userFeedbackMapper.selectAllUserFeedback();
    }
}
